#ifndef INFINITY_WIDGET_H
#	define INFINITY_WIDGET_H

namespace infinity {

class Widget
{

public : //! @name Struct
	//! @{
	struct UiVertex
	{
		dw::maths::Vector3f pos;
		dw::maths::Vector2f uv;
	};

	enum ZORDER
	{
		LAYER_BACK = 0,
		LAYER_MIDDLE ,
		LAYER_FRONT	,
		LAYER_COUNT
	};
	//! @}

	typedef std::vector< Widget * > Children;

public :
	Widget();
	virtual ~Widget();

public ://! @name Commands
	//! @{
	virtual dw::uint32 collectGeometry(/*VertexBuffer* vb, IndexBuffer *ib*/std::vector<UiVertex>* vb, std::vector< dw::uint16 >* ib, const dw::maths::Vector2f& posOffset = dw::maths::Vector2f(0.0f,0.0f));
	
	void addChild(Widget* widg);
	void deleteChildren();

	inline void setPosition(dw::maths::Vector2f pos){ m_position = pos;}
	inline void setZOrder(ZORDER zorder){ m_zOrder = zorder;}

	//! @}

protected :

	dw::maths::Vector2f m_position;
	Children m_children;
	ZORDER m_zOrder;


};

} // namespace infinity


#endif // !INFINITY_WIDGET_H
